import java.util.Scanner;

public class TestDemo {

    public static boolean fun(char s) {
        if((s >='a'&& s <= 'z') || (s >='0'&& s <='9')) {
            return true;
        }
        return false;
    }

    public static boolean isPalindrome(String s) {
        s = s.toLowerCase();
        int i= 0;
        int j = s.length()-1;
        while(i < j) {
            while(i < j && !fun(s.charAt(i))) {
                i++;
            }
            while(i < j && !fun(s.charAt(j))) {
                j--;
            }

            if(s.charAt(i) != s.charAt(j)) {
                return false;
            } else {
                i++;
                j--;
            }
        }
        return true;
    }

    public static void main(String[] args) {
       boolean fly = isPalindrome("race a car");
        System.out.println(fly);
    }
    public static void main2(String[] args) {
        Scanner scan = new Scanner(System.in);
        String ch = scan.nextLine();
        String[] str = ch.split(" ");
        System.out.println(str[str.length-1].length());
    }
    public static void main1(String[] args) {
        Scanner scan = new Scanner(System.in);
        String ch = scan.nextLine();
        StringBuffer stringBuffer = new StringBuffer(ch);
        stringBuffer.reverse();
        int count = 0;
        for(int i = 0;i<stringBuffer.length();i++) {
             char str = stringBuffer.charAt(i);
             if(str == ' ') {
                break;
             }
             count++;
        }
        System.out.println(count);
    }
}
